home *** CD-ROM | disk | FTP | other *** search
/ A Virtual Reality Guide to Texas / CD.iso / texdata / qtvrxtra.cst / 00004_Script Display Handlers.ls < prev    next >
Encoding:
Text File  |  1998-05-18  |  1.6 KB  |  59 lines

  1. -- script Display handlers
  2. -- option-clicking on a button brings up a script display window
  3. -- with the button's script
  4. -- see also 
  5.  
  6. on showScript whichCast
  7.   puppetSprite 24, true
  8.   puppetSprite 25, true
  9.   
  10.   set the locV of sprite 24 = 232
  11.   set the locV of sprite 25 = 124
  12.   
  13.   set the text of field "script display" = the scriptText of member whichCast
  14.   updatestage
  15. end
  16.  
  17. on putAwayScript
  18.   puppetSprite 24, false
  19.   puppetSprite 25, false
  20.   
  21.   updatestage
  22. end
  23.  
  24. on dragScript
  25.   -- drag script display window
  26.   global closeFlag
  27.   
  28.   set closeFlag = false
  29.   set mySprite = the clickOn
  30.   set myMember = the member of sprite mySprite
  31.   set myWidth =  the width  of member myMember
  32.   set myHeight = the height of member myMember
  33.   
  34.   set closeBoxH = 40
  35.   set closeBoxV = 18
  36.   
  37.   set scriptSprite = 25
  38.   
  39.   set internalH = the mouseH - the left of sprite mySprite
  40.   set internalV = the mouseV - the  top of sprite mySprite
  41.   
  42.   if internalH > myWidth - closeBoxH and internalV > myHeight - closeBoxV then
  43.     set closeFlag = true
  44.   else
  45.     set oldMouseH = the mouseH
  46.     set oldMouseV = the mouseV
  47.     repeat while the mouseDown
  48.       set deltaH = the mouseH - oldMouseH
  49.       set deltaV = the mouseV - oldMouseV
  50.       set the locH of sprite mySprite = the locH of sprite mySprite + deltaH
  51.       set the locV of sprite mySprite = the locV of sprite mySprite + deltaV
  52.       set the locH of sprite scriptSprite = the locH of sprite scriptSprite + deltaH
  53.       set the locV of sprite scriptSprite = the locV of sprite scriptSprite + deltaV
  54.       set oldMouseH = the mouseH
  55.       set oldMouseV = the mouseV
  56.       updatestage
  57.     end repeat
  58.   end if
  59. end